<?php
namespace app\common\model;


class CoreOrder extends Model
{
    public $columns = [
        [  "type"=> self::TYPE_INT,  "column"=>"uid",  "memo"=>"uid", "length"=> 11 ],
        [  "type"=> self::TYPE_INT,  "column"=>"good_id",  "memo"=>"good_id", "length"=> 11 ],
        [  "type"=> self::TYPE_VARCHAR,  "column"=>"order_no",  "memo"=>"订单号", "length"=> 64 ],
        [  "type"=> self::TYPE_VARCHAR,  "column"=>"payment_no",  "memo"=>"支付交易号", "length"=> 64 ],
        [  "type"=> self::TYPE_DECIMAL,  "column"=>"fee",  "memo"=>"价格", "length"=> 11 ],
        [  "type"=> self::TYPE_DECIMAL,  "column"=>"frozen_fee",  "memo"=>"冻结价格", "length"=> 11 ],
    ];

    static function orderNO($key = ''){
        return sprintf("%s%s%s%s%s",date("YmhHis"),rand(1000,9999),"op",$key,"po");
    }
}